import React, { Component } from 'react'

export default class Child extends Component {
  constructor() {
    super()
    console.log('Child constructor')
  }
  render() {
    return <div>Child</div>
  }
  componentDidMount() {
    console.log('Child did mount')
    window.onresize = () => {
      console.log('Child resize')
    }
    this.timer = setInterval(() => {
      console.log('Child interval')
    }, 1000)
  }

  componentWillUnmount() {
    console.log('Child will unmount')

    window.onresize = null
    clearInterval(this.timer)
  }
}
